<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript" src="md5.js"></script>
 <script type="text/javascript">
       function convertToMD5(){
            var plaintext = document.getElementById('password').value;
            var md5 = hex_md5(plaintext);
        
            document.getElementById('password').value = md5;
        
        }
 </script>
<div id="dangnhap">
        <h3 class="headbox">Đăng nhập</h3>
        <div class="centerbox" id="sigin">

            <!-- login form-->


            <form method="POST" action="login" name="login" onsubmit="convertToMD5()">
               
                 <%
                            
                            String error = (String) request.getAttribute("errorlogin");
                           
                %>
                Tài khoản:<br />
                <input size="20" name="username" type="text" /><br />
                Mật khẩu:<br />
                <input size="20" name="password"  type="password" id="password"/><br />
                <input value="1" name="chk_autologin" type="checkbox" /> Nhớ đăng nhập?<br /><br />
                <input class="button" name="btn_login" id="btn_login" value="Login" type="submit"
                       accesskey="return"/>
                <input class="button" name="btn_reset" value="Clear" type="reset" /><br />
                <%if(error!=null){%>
                    <div style="padding:0 10px;color:red"><%=error%></div>
                    <%}%>
                <a href="index.jsp?action=pwdreset"><small>Quên mật khẩu?</small></a>
            </form>

            <!-- end of login form-->


        </div>
        <img src="image/support_bottom.png" />
    </div>
    <div class="blank"></div>
            <!-- end of login form-->